package com.qunduikj.sjb.sdk.model.enums;

/**
 * @author Jovita
 *       "1":"2年以下","2":"2至5年","3":"5至8年","4":"8年以上"
 */
public enum DriverAge {
    OneYear(1, "2年以下"),
    TwoYear(2, "2至5年"),
    FiveYear(3, "5至8年"),
    Eight(4, "8年以上");

    // 定义私有变量
    private Integer code;
    private String driverAge;

    DriverAge(Integer code, String driverAge) {
        this.code = code;
        this.driverAge = driverAge;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDriverAge() {
        return driverAge;
    }

    public void setDriverAge(String driverAge) {
        this.driverAge = driverAge;
    }

    @Override
    public String toString() {
        return "DriverAge{" +
                "code=" + code +
                ", driverAge='" + driverAge + '\'' +
                '}';
    }

    public static String valueOf(int type) {
        DriverAge driverages[] = DriverAge.values();
        for (int i = 0; i < driverages.length; i++) {
            DriverAge pw = driverages[i];
            if (pw.getCode() == type) {
                return pw.getDriverAge();
            }
        }
        return "";
    }


}